# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>

pkgname=python-tweepy
_pypiname=tweepy
pkgver=4.12.1
pkgrel=3
pkgdesc='Python library for accessing the entire Twitter API'
url='https://www.tweepy.org/'
arch=('any')
license=('MIT')
depends=('python' 'python-oauthlib' 'python-python-socks' 'python-requests' 'python-requests-oauthlib')
makedepends=('python-build' 'python-installer' 'python-setuptools' 'python-wheel')
checkdepends=(
  'python-aiohttp'
  # 'python-async-lru'  # TODO: needs package
  'python-vcrpy'
)
optdepends=(
  'python-aiohttp: for async support'
  # 'python-async-lru: for async support'  # TODO: needs package
)
source=(https://github.com/tweepy/${_pypiname}/archive/v${pkgver}/${_pypiname}-${pkgver}.tar.gz)
sha256sums=('4c86e247be058366326b5208b86eb14bc6f5f3d10c577683c85aa695fddb6054')
sha512sums=('98ddef5922ab0b88a8555a6e5d92d6b4c5789e22fd51e858c5aab9eed20808d169181d04c27ed04d49326e374a4ff6a9af0907a6ef304ae1e19c4cdb2e257f34')

build() {
  cd ${_pypiname}-${pkgver}
  python -m build --wheel --no-isolation
}

# check() {
#   cd ${_pypiname}-${pkgver}
#   python -m unittest discover -v
# }

package() {
  cd ${_pypiname}-${pkgver}
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
  install -d "${pkgdir}/usr/share/doc/${pkgname}"
  cp -r examples "${pkgdir}/usr/share/doc/${pkgname}"
}

# vim: ts=2 sw=2 et:
